﻿// Developer Express Code Central Example:
// World Wide CRM Demo
// 
// The World Wide CRM demo is a next generation application with outstanding
// navigation capabilities and shows a reimagined view of customer contact and
// management. This demo showcases many of the most popular features of the
// WinForms Subscription.
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E3993

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using DevExpress.XtraBars;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace DevExpress.CrmDemo.Win.Helpers {
    public class ColorHelper {
        public static Form MainForm = null;
        public static Color LabelColor = Color.White;
        public static Color LabelColorLight = Color.FromArgb(201, 201, 201);
        public static Color LabelColorDark = Color.FromArgb(179, 179, 179);
        public static Color LabelColorDarkDark = Color.FromArgb(139, 139, 139);
        static void SetMenuManager(Control.ControlCollection controls, BarManager manager) {
            foreach(Control ctrl in controls) {
                BaseEdit edit = ctrl as BaseEdit;
                if(edit != null) 
                    edit.MenuManager = manager;
                if(ctrl.Controls.Count > 0) 
                    SetMenuManager(ctrl.Controls, manager);
            }
        }
        public static void SetMenuManager(Control.ControlCollection controls, string key, Form form) {
            BarManager menuManager = new BarManager();
            menuManager.Form = form;
            BarAndDockingController controller = new BarAndDockingController();
            controller.LookAndFeel.UseDefaultLookAndFeel = false;
            controller.LookAndFeel.SetSkinStyle(key);
            menuManager.Controller = controller;
            SetMenuManager(controls, menuManager);
        }
    }
}
